package com.zxinlee.account.service.impl;

import com.zxinlee.account.mapper.AccountMapper;
import com.zxinlee.account.service.AccountService;
import com.zxinlee.account.tcc.AccountTccAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

@Service
public class AccountServiceImpl implements AccountService {

    //@Autowired
    //private AccountMapper accountMapper;
    @Autowired
    private AccountTccAction accountTccAction;

    @Transactional
    @Override
    public void decrease(long userId, BigDecimal money) {
        //accountMapper.decrease(userId, money);
        accountTccAction.prepare(null,userId,money);
    }
}
